<?php
	include 'dbConnect.php'; //CHÈN VÀO CODE KẾT NỐI
?>
<?php
	class TheLoaiGame{
		public $TLG_ID;
		public $TLG_TEN_THE_LOAI;
		public $TLG_MO_TA;
	}
?>
<?php
	echo theLoaiGame();
function theLoaiGame(){
		global $con;
		$layTatCaTheLoaiGame = 'SELECT * FROM the_loai_game';
		$tatCaTheLoaiGame = mysqli_query($con,$layTatCaTheLoaiGame);
		$theLoaiGameJSON = array();
		while($theLoaiGame = mysqli_fetch_array($tatCaTheLoaiGame))
		{
			$ttg = new TheLoaiGame();
			$ttg -> TLG_ID = $theLoaiGame['TLG_ID'];
			$ttg -> TLG_TEN_THE_LOAI = $theLoaiGame['TLG_TEN_THE_LOAI'];
			$ttg -> TLG_MO_TA =$theLoaiGame['TLG_MO_TA'];
			$theLoaiGameJSON[] = $ttg;
		}
		$theLoaiGameJSONResponse = array("JSONResponse" =>$theLoaiGameJSON);
		return json_encode($theLoaiGameJSONResponse);
	}





		mysqli_close($con);

?>